﻿using Microsoft.LightSwitch;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;

namespace LightSwitchApplication
{
    public partial class Book
    {
        partial void PercentageOfCompletion_Compute(ref decimal result)
        {
            if (this.NumberOfPages > 0)
            {
                decimal readTill = this.ReadTillPageNumber;
                decimal numOfPage = this.NumberOfPages;
                result = (readTill / numOfPage) ;
            }
            else
            {
                result = 0;
            }
        }
    }
}